//
//  AWThemeManager.h
//  changeShin
//
//  Created by Alan Wang on 2019/3/25.
//  Copyright © 2019 Alan Wang. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
typedef NS_ENUM(NSInteger, AWThemeType) {
    AWThemeTypeMainBundle,
    AWThemeTypeSandbox
};



#define AWThemeImageForKey(key)      [[AWThemeManager shareInstance] imageForKey:key]
#define AWThemeColorForKey(key)      [[AWThemeManager shareInstance] colorForKey:key]
#define AWThemeFloatForKey(key)      [[AWThemeManager shareInstance] floatForKey:key]
#define AWThemeBoolForKey(key)       [[AWThemeManager shareInstance] boolForKey:key]
#define AWThemeStringForKey(key)     [[AWThemeManager shareInstance] stringForKey:key]
#define AWThemeUIntegerForKey(key)   [[AWThemeManager shareInstance] uIntegerForKey:key]
#define AWThemeFontForKey(key)       [[AWThemeManager shareInstance] fontForKey:key]
#define AWThemeBoldfontForKey(key)   [[AWThemeManager shareInstance] boldfontForKey:key]

#define AWThemeImageNameFromBuddle(name,buddlename)      [[AWThemeManager shareInstance] imageForName:name fromBudddle:buddlename]


NS_ASSUME_NONNULL_BEGIN

@interface AWThemeManager : NSObject
+(instancetype)shareInstance;
//给当前配色文件设置别名
@property(nonatomic,copy) NSString * skinName;
//添加某个配置路径的皮肤 前面添加的也有效
-(void)addConfigFilePath:(NSString*)path themeType:(AWThemeType)type;
//移除某个路径的皮肤 剩下的还生效
-(void)removeConfigFilePath:(NSString*)path;
//删除以前的所有添加的配置文件 新增Path下的文件
-(void)resetConfigWithFilePath:(NSString*)path themeType:(AWThemeType)type;
//移除全部的皮肤文件
-(void)removeAll;
//更换主题
-(void)changeTheme;


#pragma mark--辅助方法自定义处理使用
-(UIImage*)imageForKey:(NSString*)key;
-(UIColor*)colorForKey:(NSString*)key;
-(CGFloat)floatForKey:(NSString*)key;
-(BOOL)boolForKey:(NSString*)key;
-(NSString*)stringForKey:(NSString*)key;
-(NSUInteger)uIntegerForKey:(NSString*)key;
-(UIFont*)fontForKey:(NSString*)key;
-(UIFont*)boldfontForKey:(NSString*)key;

#pragma mark--居于buddle图片的API
//key是图片名称  最终图片加载的是 buddleName_skinName/xxx@x.png
-(UIImage*)imageForName:(NSString*)key fromBudddle:(NSString*)buddleName;


@end

NS_ASSUME_NONNULL_END
